﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebApplication.BaseClass
{
    public class MessageBase
    {
        public string ToUserName { get; set; }
        public string FromUserName { get; set; }
        public DateTime CreateTime { get; set; }
    }
    /// <summary> 
    /// 所有Request和Response消息的数据格式规范
    /// </summary>
    public interface IMessageBase
    {
        string ToUserName { get; set; }
        string FromUserName { get; set; }
        DateTime CreateTime { get; set; }
    }
    public interface IRequestMessageBase : IMessageBase
    {
        RequestMsgType MsgType { get; }

        long MsgId { get; set; }
    }

    public interface IRequestMessageEventBase : IRequestMessageBase
    {
        /// <summary>
        /// 事件类型
        /// </summary>
        Event Event { get; }
        /// <summary>
        /// 事件KEY值，与自定义菜单接口中的Key值对应
        /// </summary>
        string EventKey { get; set; }
    }

    public interface IResponseMessageBase : IMessageBase
    {
        ResponseMsgType MsgType { get; }
    }

    public enum RequestMsgType
    {
        //文本消息
        Text,
        //地理位置消息
        Location,
        //图片消息
        Image,
        //语音消息
        Voice,
        //视频消息
        Video,
        //链接消息
        Link,
        //事件消息
        Event
    }

    /// <summary>
    /// 事件枚举类型
    /// </summary>
    public enum Event
    {
        //上报地理位置事件
        LOCATION,
        //关注事件
        subscribe,
        //取消关注事件
        unsubscribe,
        //自定义菜单单击事件
        CLICK,
        //扫描带参数二维码事件 
        scan
    }

    public enum ResponseMsgType
    {
        /// <summary>
        /// 回复文本消息
        /// </summary>
        Text,
        /// <summary>
        /// 回复图文消息
        /// </summary>
        News,
        /// <summary>
        /// 回复音乐消息
        /// </summary>
        Music,
        /// <summary>
        /// 回复图片消息
        /// </summary>
        Image,
        /// <summary>
        /// 回复语音消息
        /// </summary>
        Voice,
        /// <summary>
        /// 回复视频消息
        /// </summary>
        Video
    }
}